package io.buffered;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;

public class Demo01BufferedInputStream {
    public static void main(String[] args) throws Exception {

//        File file = new File("F://Test//T1//a.txt");
//        FileInputStream fis = new FileInputStream(file);
//        BufferedInputStream bis = new BufferedInputStream(fis);
//        BufferedInputStream bis = new BufferedInputStream(fis,102400);

        BufferedInputStream bis = new BufferedInputStream(new FileInputStream(new File("F://Test//T1//a.txt")), 102400);

        byte[] bytes = new byte[1024];
        int length;
        while ((length = bis.read(bytes)) != -1) {
            System.out.println(new String(bytes, 0, length));
        }

    }
}
